package com.yin.myproject.design.proxydesign;

/**
 * @author Eason
 * @create 2018-05-03 22:01
 **/
public class Proxy implements Action {
    private Action realObject;

    public Proxy(Action realObject) {
        this.realObject = realObject;
    }

    private void before(){
        System.out.println("before");
    }

    private void after(){
        System.out.println("after");
    }

    @Override
    public void doSomething() {
        System.out.println("Proxy do");
        before();
        realObject.doSomething();
    after();
        }
}
